{extend name="base" /}
{block name="main"}
<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        交易列表
    </div>
    <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">交易管理</a></li>
        <li class="am-active">交易列表</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold">
                <span class="am-icon-code"></span> 列表
            </div>
            <div class="tpl-portlet-input tpl-fz-ml">
                <div class="portlet-input input-small input-inline">
                    <div class="input-icon right">
                        <i class="am-icon-search"></i>
                        <input type="text" class="form-control form-control-solid" id="findcode" placeholder="查看近期数据(day)"> </div>
                </div>
            </div>


        </div>
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">

                    </div>
                </div>


            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main am-table-centered">
                            <thead>
                            <tr>
                                <th class="table-id">ID</th>
                                <th class="table-title">用户</th>
                                <th class="table-type">股票名称</th>
                                <th class="table-type">股票代码</th>
                                <th class="table-date">数量</th>
                                <th class="table-date">买入价</th>
                                <th class="table-date">卖出价</th>
                                <th class="table-date">盈亏</th>
                                <th class="table-date">买入单号</th>
                                <th class="table-date">卖出单号</th>
                                <th class="table-date">买入时间</th>
                                <th class="table-date">卖出时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if empty($data)} <td colspan="13">无信息</td>
                            {else}
                            {volist name='data' id='order'}
                            <tr>
                                <td>{$order.id}</td>
                                <td>{$order.uid}</td>
                                <td>{$order.stockname}</td>
                                <td>{$order.stockcode}</td>
                                <td>{$order.count}</td>
                                <td>{$order.buyprice}</td>
                                <td>{$order.sellprice}</td>
                                <td>{$order.yk}</td>
                                <td>{$order.buyoid}</td>
                                <td>{$order.selloid}</td>
                                <td>{:formatTime($order.buytime)}</td>
                                <td>{:formatTime($order.selltime)}</td>

                            </tr>
                            {/volist}
                            {/if}
                            </tbody>
                        </table>
                        <div class="am-cf">
                            <div class="am-fr">
                                {$data->render()}
                            </div>
                        </div>
                        <hr>

                    </form>
                </div>

            </div>
        </div>
        <div class="tpl-alert"></div>
    </div>
</div>

<script>
    $(function () {
        $('.btn-del').click(function(){
            var id = $(this).attr('iddata');
            var obj = $(this).parents('tr');
//                console.log($(this).attr('iddata'))
            if(confirm('你确定要删除该询价吗')){
                delajax(id,obj,'ask');
//                    $('.rolecount').html($('.rolecount').html()-1);
            }
        })
    });

    $('.am-icon-search').click(function () {
        var day = $('#findcode').val();
            if(day){
                window.location.href = '/order/'+day;
            }
//        window.location.href = '/goods/'+day;
    })
</script>
{/block}